package com.fh.listener;

import com.fh.model.OnlineCounter;
import com.fh.util.IpUtil;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * 创建者：shanlin
 * 创建时间：2017/12/23 10:05
 * @author
 **/
@WebListener
public class OnlineCounterListener implements HttpSessionListener {
	@Override
	public void sessionCreated(HttpSessionEvent httpSessionEvent) {
		// none
	}
	
	@Override
	public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
		OnlineCounter.sub(httpSessionEvent.getSession().getId());
	}
}
